# 定义 Product 接口
class Product:
    def operation(self):
        pass

# 定义 ContereProductA 类，继承自 Product
class ContereProductA(Product):
    def operation(self):
        return "ContereProductA operation"

# 定义 ContereProductB 类，继承自 Product
class ContereProductB(Product):
    def operation(self):
        return "ContereProductB operation"

# 定义 Facotry 类，用于创建 Product 的实例
class Facotry:
    def create_product(self, product_type):
        if product_type == 'A':
            return ContereProductA()
        elif product_type == 'B':
            return ContereProductB()
        else:
            raise ValueError("Invalid product type")

# 测试代码
if __name__ == "__main__":
    factory = Facotry()
    product_a = factory.create_product('A')
    product_b = factory.create_product('B')

    # 运行结果
    print(product_a.operation())  # 输出: ContereProductA operation
    print(product_b.operation())  # 输出: ContereProductB operation